/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.business.rest;

import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import me.zhengjie.business.domain.sup.Gsgl;
import me.zhengjie.business.service.GsglService;
import me.zhengjie.business.service.HomeService;
import me.zhengjie.business.service.LargeScreenService;
import me.zhengjie.business.service.dto.HomeQueryCriteria;
import me.zhengjie.utils.SecurityUtils;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
* @website https://el-admin.vip
* @author xiahongbo
* @date 2022-05-25
**/
@RestController
@RequiredArgsConstructor
@Api(tags = "大屏统计")
@RequestMapping("/api/largeScreen")
public class LargeScreenController {

    private final LargeScreenService largeScreenService;


    @GetMapping(value = "/queryLeft1")
    @ApiOperation("查询查询大屏左1(每月各区申请人数)")
    public ResponseEntity<Object> queryLeft1(String starttime, String endtime, @RequestParam String zhlb) {

        return new ResponseEntity<>(largeScreenService.queryLeft1(starttime, endtime, zhlb),HttpStatus.OK);
    }

    @GetMapping(value = "/queryLeft2")
    @ApiOperation("查询查询大屏左2(每月申请人数)")
    public ResponseEntity<Object> queryLeft2(String starttime, String endtime, @RequestParam String zhlb) {

        return new ResponseEntity<>(largeScreenService.queryLeft2(starttime, endtime, zhlb),HttpStatus.OK);
    }


    @GetMapping(value = "/queryLeft3")
    @ApiOperation("查询查询大屏左3(每月职工、居民的申请人数)")
    public ResponseEntity<Object> queryLeft3(String starttime, String endtime, @RequestParam String zhlb) {

        return new ResponseEntity<>(largeScreenService.queryLeft3(starttime, endtime, zhlb),HttpStatus.OK);
    }

    @GetMapping(value = "/queryLeft4")
    @ApiOperation("查询查询大屏左4(每月已签约人数)")
    public ResponseEntity<Object> queryLeft4(String starttime, String endtime, @RequestParam String zhlb) {

        return new ResponseEntity<>(largeScreenService.queryLeft4(starttime, endtime, zhlb),HttpStatus.OK);
    }

    @GetMapping(value = "/queryLeft5")
    @ApiOperation("查询查询大屏左5(每月已服务人数)")
    public ResponseEntity<Object> queryLeft5(String starttime, String endtime, @RequestParam String zhlb) {

        return new ResponseEntity<>(largeScreenService.queryLeft5(starttime, endtime, zhlb),HttpStatus.OK);
    }

    @GetMapping(value = "/queryCenter3")
    @ApiOperation("查询查询中间(每月已服务人数)")
    public ResponseEntity<Object> queryCenter3(String starttime, String endtime, @RequestParam String zhlb) {

        return new ResponseEntity<>(largeScreenService.queryCenter3(starttime, endtime, zhlb),HttpStatus.OK);
    }

    @GetMapping(value = "/queryRigth1")
    @ApiOperation("查询查询右侧1(每月评估人数)")
    public ResponseEntity<Object> queryRigth1(String starttime, String endtime, @RequestParam String zhlb) {

        return new ResponseEntity<>(largeScreenService.queryRigth1(starttime, endtime, zhlb),HttpStatus.OK);
    }

    @GetMapping(value = "/queryRigth2")
    @ApiOperation("查询查询右侧2(每月复核人数)")
    public ResponseEntity<Object> queryRigth2(String starttime, String endtime, @RequestParam String zhlb) {

        return new ResponseEntity<>(largeScreenService.queryRigth2(starttime, endtime, zhlb),HttpStatus.OK);
    }

    @GetMapping(value = "/queryRigth3")
    @ApiOperation("查询查询右侧3(机构已享受待遇各失能等级人员数量)")
    public ResponseEntity<Object> queryRigth3(String starttime, String endtime, @RequestParam String zhlb) {

        return new ResponseEntity<>(largeScreenService.queryRigth3(starttime, endtime, zhlb),HttpStatus.OK);
    }

    @GetMapping(value = "/queryRigth4")
    @ApiOperation("查询查询右侧4(机构已享受待遇各参保类型人员数量)")
    public ResponseEntity<Object> queryRigth4(String starttime, String endtime, @RequestParam String zhlb) {

        return new ResponseEntity<>(largeScreenService.queryRigth4(starttime, endtime, zhlb),HttpStatus.OK);
    }

    @GetMapping(value = "/queryRigth44")
    @ApiOperation("查询查询右侧4(居家已享受待遇各参保类型人员数量)")
    public ResponseEntity<Object> queryRigth44(String starttime, String endtime, @RequestParam String zhlb) {

        return new ResponseEntity<>(largeScreenService.queryRigth44(starttime, endtime),HttpStatus.OK);
    }

    @GetMapping(value = "/queryRigth5")
    @ApiOperation("查询查询右侧5(居家对比)")
    public ResponseEntity<Object> queryRigth5(String starttime, String endtime, @RequestParam String zhlb) {

        return new ResponseEntity<>(largeScreenService.queryRigth5(starttime, endtime, zhlb),HttpStatus.OK);
    }

    @GetMapping(value = "/queryTop")
    @ApiOperation("查询查询最上面(概况)")
    public ResponseEntity<Object> queryTop(String starttime, String endtime, @RequestParam String zhlb) {

        return new ResponseEntity<>(largeScreenService.queryTop(starttime, endtime, zhlb),HttpStatus.OK);
    }

    @GetMapping(value = "/queryHomeGs")
    @ApiOperation("查询查询中间地图坐标(查询居家)")
    public ResponseEntity<Object> queryHomeGs(String jg) {

        return new ResponseEntity<>(largeScreenService.queryHomeGs(jg),HttpStatus.OK);
    }

    @GetMapping(value = "/queryOrgGs")
    @ApiOperation("查询查询中间地图坐标(查询机构)")
    public ResponseEntity<Object> queryOrgGs(String jg) {

        return new ResponseEntity<>(largeScreenService.queryOrgGs(jg),HttpStatus.OK);
    }

    @GetMapping(value = "/queryAmount")
    @ApiOperation("查询每月统筹金额")
    public ResponseEntity<Object> queryAmount(String starttime, String endtime, @RequestParam String zhlb) {

        return new ResponseEntity<>(largeScreenService.queryAmount(starttime, endtime, zhlb),HttpStatus.OK);
    }
}